﻿using System.Web.Mvc;
using System.Web.Security;

namespace prjYan.Forum.Controllers
{
    public class BaseController : Controller
    {
        //
        // GET: /Base/

        public int GetUserId
        {
            get
            {
                if (Request.IsAuthenticated)
                {
                    var membership = (WebMatrix.WebData.SimpleMembershipProvider)Membership.Provider;
                    int idUser = membership.GetUserId(User.Identity.Name);

                    return idUser;
                }

                return 0;
            }
        }
    }
}
